export const dictMainTableConfig = {
  blockTitle: '页面关联的字典',
  fields: [
    { id: '001', prop: 'dictName', label: '名称', width: '160' },
    { id: '002', prop: 'dictCode', label: '编码' },
    { id: '003', prop: 'category', label: '分类', width: '260' },
    { id: '004', prop: 'isPublic', label: '是否公开', width: '100', align: 'center' },
    {
      id: '007',
      label: '操作',
      width: '148',
      items: [
        {
          id: '01',
          type: 'button',
          opt: {
            type: 'primary',
            text: '编辑',
            action: 'editDictMain',
          },
        },
        {
          id: '02',
          type: 'button',
          opt: {
            type: 'danger',
            text: '移除',
            action: 'removeDictMain',
          },
        },
      ],
    },
  ],
}

export const dictMainFormConfig = {
  blockTitle: '数据字典',
  tableName: 'z_dictMain',
  groups: [
    {
      fields: [
        { id: '001', model: 'id', label: '唯一编号', width: '', type: 'input', disabled: 'Y' },
        {
          id: '002',
          model: 'dictName',
          label: '字典名称',
          width: '',
          type: 'input',
          rules: [{ required: true, message: '必填项', trigger: 'blur' }],
        },

        { id: '003', model: 'dictCode', label: '字典编码', width: '', type: 'input', disabled: 'Y' },
        {
          id: '004',
          model: 'category',
          label: '分类',
          width: '',
          type: 'select',
          opt: [
            { value: 'b673b073-6c5f-40e0-af0e-1c6cc4de345b', label: '未分类' },
            { value: '413b30b1-9a88-48b1-8dfc-1ee1cffa59f3', label: '档案管理' },
          ],
          rules: [{ required: true, message: '必填项', trigger: 'blur' }],
        },
        { id: '005', model: 'description', label: '描述', width: '', type: 'input' },
        { id: '006', model: 'isPublic', label: '是否公用', width: '', type: 'switch', opt: { activeValue: 'Y', inactiveValue: 'N' } },
      ],
    },
  ],
}

export const dictTableConfig = {
  blockTitle: '页面关联的字典',
  fields: [
    { id: '001', prop: 'dtext', label: '标签', width: '120' },
    { id: '002', prop: 'dvalue', label: '值' },
    {
      id: '007',
      label: '操作',
      width: '148',
      items: [
        {
          id: '01',
          type: 'button',
          opt: {
            type: 'primary',
            text: '编辑',
            action: 'editDict',
          },
        },
        {
          id: '02',
          type: 'button',
          opt: {
            type: 'danger',
            text: '移除',
            action: 'removeDict',
          },
        },
      ],
    },
  ],
}

export const dictFormConfig = {
  blockTitle: '数据字典',
  tableName: 'z_dictMain',
  groups: [
    {
      fields: [
        { id: '001', model: 'id', label: '键值ID', width: '', type: 'input', disabled: 'Y' },
        { id: '011', model: 'mid', label: '字典ID', width: '', type: 'input', disabled: 'Y' },

        {
          id: '002',
          model: 'dtext',
          label: '键名',
          width: '',
          type: 'input',
          rules: [{ required: true, message: '必填项', trigger: 'blur' }],
        },

        { id: '003', model: 'dvalue', label: '键值', width: '', type: 'input', rules: [{ required: true, message: '必填项', trigger: 'blur' }] },
      ],
    },
  ],
}
